import org.junit.Test;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author Liu Chang
 * @Date 2021/5/19 3:26 下午
 */
public class test {

    Map<Integer, String> map = new HashMap<>();

    @Test
    public void entrySetTest() {

        map.put(1, "zhangsan");
        map.put(2, "lisi");
        map.put(3, "wangwu");

        System.out.println("-------map-----");
        System.out.println(map);
        for (Map.Entry<Integer, String> entry: map.entrySet()) {
            System.out.println("-----entry-----");
            System.out.println(entry);

            System.out.println("----entry - key----");
            System.out.println(entry.getKey());

            System.out.println("----entry - value----");
            System.out.println(entry.getValue());
        }
    }

}
